
<template>
  <div class="bucket-container">
    <div class="bucket-navbar-container">
      <el-menu class="bucket-menu" :router="true" :default-active="activeIndex">
        <el-menu-item-group>
          <template slot="title">基本设置</template>
          <el-menu-item
            index="/manufacture/manufactureGoods"
          >
            <i class="el-icon-odometer" />
            <span slot="title">货品信息</span>
          </el-menu-item>
          <el-menu-item
            :index="'/manufacture/equipment/' + toBase64X('1', 'equipment')"
          >
            <i class="el-icon-odometer" />
            <span slot="title">仪器设备</span>
          </el-menu-item>
          <el-menu-item :index="'/manufacture/bom/' + toBase64X('1', 'bom')">
            <i class="el-icon-orange" />
            <span slot="title">BOM管理</span>
          </el-menu-item>
          <el-menu-item
            :index="'/manufacture/technique/' + toBase64X('1', 'technique')"
          >
            <i class="el-icon-guide" />
            <span slot="title">生产工艺</span>
          </el-menu-item>
          <el-menu-item
            :index="'/manufacture/template/' + toBase64X('1', 'template')"
          >
            <i class="el-icon-notebook-2" />
            <span slot="title">记录模板</span>
          </el-menu-item>
        </el-menu-item-group>
        <el-menu-item-group>
          <template slot="title">生产管理</template>
          <el-menu-item index="/manufacture/order">
            <i class="el-icon-bottom-right" />
            <span slot="title">生产通知</span>
          </el-menu-item>
          <el-menu-item index="/manufacture/task">
            <i class="el-icon-date" />
            <span slot="title">过程记录</span>
          </el-menu-item>
          <el-menu-item index="/manufacture/result">
            <i class="el-icon-finished" />
            <span slot="title">交付结果</span>
          </el-menu-item>
        </el-menu-item-group>
        <el-menu-item-group>
          <template slot="title">报表管理</template>
          <el-menu-item index="/manufacture/manufactureHandOrder">
            <i class="el-icon-check" />
            <span slot="title">待交付报表</span>
          </el-menu-item>
          <el-menu-item index="/manufacture/manufactureTask">
            <i class="el-icon-user" />
            <span slot="title">生产任务列表</span>
          </el-menu-item>
        </el-menu-item-group>
      </el-menu>
    </div>
    <div class="bucket-main-container">
      <router-view />
    </div>
  </div>
</template>

<script>
import { toBase64X } from '@/utils/string-util'

export default {
  data() {
    return {
      index: '/manufacture/order',
      listQuery: {
        pageNumber: 1,
        pageIndex: 0,
        pageSize: 10
      },
      activeIndex: '/manufacture/order'
    }
  },
  mounted() {
    this.setCurrentRoute()
  },
  methods: {
    toBase64X,
    setCurrentRoute() {
      this.$nextTick(() => {
        this.activeIndex = this.$route.path
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.bucket-menu {
  .el-menu-item {
    .el-badge {
      height: 24px;
      line-height: 24px;
    }
  }
}
</style>
